<?php
/**
 *  Boolean AND.
 *
 * An object of the WorkflowConditionAnd class represents a boolean AND expression. It
 * can hold an arbitrary number of WorkflowCondition objects.
 *
 * <code>
 * <?php
 * $and = new Workflow_Condition_And( array( $condition , ... ) );
 * ?>
 * </code>
 * 
 * @author dengdl
 *
 */
class Workflow_Condition_And extends Workflow_Condition_BooleanSet
{
	/**
     * Evaluates this condition with $value and returns true if the condition holds and false otherwise.
     *
     * @param  mixed $value
     * @return boolean true when the condition holds, false otherwise.
     * @ignore
     */
    public function evaluate( $value )
    {
        foreach ( $this->conditions as $condition )
        {
            if ( !$condition->evaluate( $value ) )
            {
                return false;
            }
        }

        return true;
    }
}
?>